<?php
class Textdiff {
	
	private $olds, $news;
	/**
	 * 
	 */
	function __construct($old, $new, $regexp) 
	{
		preg_match_all($regexp, $old, $matches);
		$this->olds = $matches[1];
		preg_match_all($regexp, $new, $matches);
		$this->news = $matches[1];
	}
	function News(){	return array_diff($this->news, $this->olds);	}
	function Olds(){	return array_diff($this->olds, $this->news);	}
}
?>